package com.landscope.issue.utils;

import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

/**
 * @author qzp
 * @version v1.0
 * @date 2021/8/22 13:55
 **/
@Service
public class ImageUtil {

    //地图底图地址
    private String url = "http://114.116.210.180:8001";

    public String formatImageUrl(String imageUrl) {
        if (StrUtil.isNotEmpty(imageUrl))
            imageUrl = imageUrl.replaceAll("D:\\\\landscope", url).replaceAll("\\\\","/");
        return imageUrl;
    }

    public static void main(String[] strs){
        String url = "http://114.116.210.180:8001/";
        String str = "D:\\landscope\\pbg\\1.jpg;D:\\landscope\\pbg\\2.jpg";
        String imageUrl = str.replaceAll("D:\\\\landscope", url).replaceAll("\\\\","/");
        System.out.println(imageUrl);
    }
}
